/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ejerciciosmiercoles;

 import java.util.Scanner;

public class NumeroLetras {

     public static void main (String [] args){

         Scanner sc=new Scanner(System.in);
          System.out.println("Introduce la cadena");
           String cad=sc.next();

          /*Divide el split la cadena en torno a la coma*/
           
           String array []=cad.split(",");
             for(int x=0; x<array.length; x=x+2){
               int num=Integer.parseInt(array[x]);
                 for(int y=0; y<num; y++){
                     System.out.print(array[x+1]);
                 }
                    System.out.print(",");
             }
     }
}
